﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

[ExecuteInEditMode]
public class shaderController : MonoBehaviour {
    public Material material;
    public Texture tex;

    private void OnEnable () {
        if (material == null)
            material = this.gameObject.GetComponent<Renderer> ().material;
        material.SetTexture ("_MainTex", tex);
    }
}